Skip to content

Remove code for ThinLTO from cg_gcc#152566

Open
bjorn3 wants to merge 1 commit intorust-lang:mainfrom
bjorn3:cg_gcc_no_thin_lto
Open

Remove code for ThinLTO from cg_gcc#152566
bjorn3 wants to merge 1 commit intorust-lang:mainfrom
bjorn3:cg_gcc_no_thin_lto

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Feb 13, 2026

It was just a dummy implementation to workarround the fact that thin local lto is the default in rustc. By adding a thin_lto_supported thin local lto can be automatically disabled for cg_gcc, removing the need for this dummy implementation. This makes improvements to the LTO handling on the cg_ssa side a lot easier.

cc #rustc-codegen-gcc > thin LTO implementation
This should make the work on rust-lang/compiler-team#908 easier.

r? rust-lang/wg-gcc-backend

@bjorn3 bjorn3 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. A-LTO Area: Link-time optimization (LTO) A-gcc Things relevant to the [future] GCC backend labels Feb 13, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 13, 2026

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

rustc_macros::diagnostics was changed

cc @davidtwco, @TaKO8Ki, @JonathanBrouwer

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 13, 2026
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch from 391291e to f5d451d Compare February 13, 2026 10:14
@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch from f5d451d to a7dc3b0 Compare February 13, 2026 10:40
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch 2 times, most recently from 9801a76 to 2c4a301 Compare February 13, 2026 11:30
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch from 2c4a301 to fe75297 Compare February 13, 2026 12:29
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch from d73f5d4 to 810a137 Compare February 13, 2026 14:16
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch 3 times, most recently from 445a2d7 to 1d32b5d Compare February 13, 2026 15:30
It was just a dummy implementation to workarround the fact that thin
local lto is the default in rustc. By adding a thin_lto_supported thin
local lto can be automatically disabled for cg_gcc, removing the need
for this dummy implementation. This makes improvements to the LTO
handling on the cg_ssa side a lot easier.
@bjorn3 bjorn3 force-pushed the cg_gcc_no_thin_lto branch from 1d32b5d to fa753a4 Compare February 15, 2026 10:06
@rustbot
Copy link
Collaborator

rustbot commented Feb 15, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Contributor

@antoyo antoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
Please remove the ThinBuffer struct if it's not needed.

View changes since this review

// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
unsafe impl Sync for SyncContext {}

pub struct ThinBuffer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this struct still needed?
Could we juste use

type ThinBuffer = ();

below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be a type implementing ThinBufferMethods. It will go away in future PR by merging the ModuleBuffer and ThinBuffer associated types.

@bjorn3
Copy link
Member Author

bjorn3 commented Feb 15, 2026

@bors r=antoyo

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 15, 2026

📌 Commit fa753a4 has been approved by antoyo

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 15, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 15, 2026
Remove code for ThinLTO from cg_gcc

It was just a dummy implementation to workarround the fact that thin local lto is the default in rustc. By adding a thin_lto_supported thin local lto can be automatically disabled for cg_gcc, removing the need for this dummy implementation. This makes improvements to the LTO handling on the cg_ssa side a lot easier.

cc [#rustc-codegen-gcc > thin LTO implementation](https://rust-lang.zulipchat.com/#narrow/channel/386786-rustc-codegen-gcc/topic/thin.20LTO.20implementation/with/573625132)
This should make the work on rust-lang/compiler-team#908 easier.

r? rust-lang/wg-gcc-backend
rust-bors bot pushed a commit that referenced this pull request Feb 15, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #152566 (Remove code for ThinLTO from cg_gcc)
 - #152278 (Fix const normalization for generic const items with trait assoc consts)
 - #152604 (Relocate some tests)
 - #152625 (Provide all lint group names to Clippy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-gcc Things relevant to the [future] GCC backend A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-LTO Area: Link-time optimization (LTO) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants